#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion


namespace Weazel.Gezel.Simulator.Reference
{
  public class DatapathInstruction
  {
    private List<Symid> instructions;

    /// <summary>
    /// Returns the number of instructions
    /// contained in this instance.
    /// </summary>
    /// <value></value>
    public int InstructionCount
    {
      get
      {
        return instructions.Count;
      }
    }

    public DatapathInstruction()
    {
      instructions = new List<Symid>();
    }

    internal void AddSignalFlowGraph(Symid sfgId)
    {
      instructions.Add(sfgId);
    }

    public void Select(DatapathContext datapathContext)
    {
      // clear the list of active sfg's
      datapathContext.Clear();

      foreach (int i in instructions)
        datapathContext.ActivateSignalFlowGraph(i);
    }
  }
}